#import the date module
from datetime import date

#define how many days are in a gregorian month
gregorianDays = {'January':31, 'February':False, 'March':31, 'April':30, 'May':31, 'June':30, 'July':31, 'August':31, 'September':30, 'October':31, 'November':30, 'December':31}
#the calendar class
class gregorian:
    def __init__(self):
        #create the main calendar dictionary  
        #an example of access to this calender is self.cal['1900']['February']['28'] which will return the dictionary created by self.day()
        self.cal = {}
        #add a starting number of years to the calender
        for i in range(150):
            #note the year being created
            #year = date.today().year + i
            year = i + 1900
            #add the months
            self.cal[str(year)] = {'January':{}, 'February':{}, 'March':{}, 'April':{}, 'May':{}, 'June':{}, 'July':{}, 'August':{}, 'September':{}, 'October':{}, 'November':{}, 'December':{}}
            #go through the months to add days
            for month in ['January','February','March','April','May','June','July','August','September','October','November','December']:
                #for each day loop through and add
                if month == 'February':
                    if year % 4  == 0 and (year % 100 != 0 or year % 400 == 0):
                        dayNo = 29
                    else:
                        dayNo = 28
                else:
                    dayNo = gregorianDays[month]
                for day in range(dayNo):
                    day += 1
                    self.cal[str(year)][str(month)][str(day)] = self.day()
    def day(self):
        #create a shell for events
        events = {}
        return {'events':events}